package com.fonddram.loader;

import android.content.Context;
import android.content.CursorLoader;
import android.database.Cursor;
import android.provider.ContactsContract;

/**
 * User: fenghb
 * Date: 13-11-30
 * Time: 下午2:53
 */
public class ContactCursorLoader extends CursorLoader {
    private Context mContext;
    private String[] mContactProjection = {
            ContactsContract.Contacts._ID,
            ContactsContract.Contacts.DISPLAY_NAME
    };


    public ContactCursorLoader(Context context) {
        super(context);
        this.mContext = context;
    }


    @Override
    protected Cursor onLoadInBackground() {
        Cursor mCursor = mContext.getContentResolver()
                .query(ContactsContract.Contacts.CONTENT_URI,
                        mContactProjection, null, null, null);
        return mCursor;
    }
}
